DOUBLE PRECISION FUNCTION fact(n)
INTEGER,INTENT(IN) :: n
INTEGER :: i
INTEGER :: p=1
DO i=1,n
    p=i*p
END DO
fact=p
END FUNCTION fact

SUBROUTINE generatePermutations(n,table)
IMPLICIT NONE
INTEGER,INTENT(IN) :: n
INTEGER,INTENT(INOUT),ALLOCATABLE,DIMENSION(:) :: table
DOUBLE PRECISION :: rows
rows=fact(n+5)/(fact(n)*fact(5))
print *,rows
!ALLOCATE(table(fact(n+5)/(n
END SUBROUTINE generatePermutations

PROGRAM energy
IMPLICIT NONE
INTEGER :: n ! no of particles
INTEGER,ALLOCATABLE,DIMENSION(:) :: table
REAL, PARAMETER :: pi=3.14159265359

call generatePermutations(10,table)

END PROGRAM
